package com.wst.system.server.mapper;

import com.wst.system.server.entity.SysFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 文件表 Mapper 接口
 * </p>
 *
 * @author X.I.O
 * @since 2025-02-27
 */
public interface SysFileMapper extends BaseMapper<SysFile> {


    @Update({"<script>",
            "   UPDATE sys_file",
            "       SET file_permission = #{permiession}",
            "           WHERE file_uid=#{uid} and id IN",
            "            <foreach collection='ids' item='id' open='(' separator=',' close=')'>",
            "                   #{id}",
            "            </foreach>",
            "</script>"})
    int updateBatchPermession(@Param("ids") List<String> ids, @Param("permiession") String permiession,@Param("uid")String uid);

}